package com.macro.mall.model;

import cn.hutool.json.JSONObject;
import com.macro.mall.common.api.PageReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * cur_video实体类
 *
 * @author gaodx
 *
 */
@Data
@ApiModel(description = "视频请求报文",value = "视频请求报文")
public class CurVideo extends PageReq implements Serializable{
	/**主键*/
    @ApiModelProperty(value = "主键")
	private Long id; 
	/**视频名称*/
    @ApiModelProperty(value = "视频名称")
	private String videoName; 
	/**视频时长*/
    @ApiModelProperty(value = "视频时长")
	private String videoTime; 
	/**视频地址*/
    @ApiModelProperty(value = "视频地址")
	private String videoAddr; 
	/**视频封面*/
    @ApiModelProperty(value = "视频封面")
	private String videoPic; 
	/**视频描述*/
    @ApiModelProperty(value = "视频描述")
	private String videoDesc; 
	/**归属部门*/
    @ApiModelProperty(value = "归属部门")
	private Long deptId; 
	/**状态*/
    @ApiModelProperty(value = "状态")
	private Integer status; 
	/**创建时间*/
    @ApiModelProperty(value = "创建时间")
	private Date createTime; 
	/**创建人*/
    @ApiModelProperty(value = "创建人")
	private String createBy; 
	/**更新时间*/
    @ApiModelProperty(value = "更新时间")
	private Date updateTime; 
	/**更新人*/
    @ApiModelProperty(value = "更新人")
	private String updateBy;
	/**价格*/
    @ApiModelProperty(value = "价格")
	private String price;
	/**播放次数*/
    @ApiModelProperty(value = "播放次数")
	private String playCount;
	/**售卖类型*/
    @ApiModelProperty(value = "售卖类型")
	private String priceTypeName;


    /**课程标识*/
    @ApiModelProperty(value = "课程标识")
    private Long courseId;
    /**
	 * 实例化
	 */
	public CurVideo() {
		super();
	}
	/**
	 * 实例化
	 * 
	 * @param obj
	 */

	public CurVideo(JSONObject obj) {
		this();
		if (obj.get("id") instanceof Number) {
			this.setId(((Number) obj.get("id")).longValue());
		}
		if (obj.get("videoName") instanceof String) {
			this.setVideoName((String) obj.get("videoName"));
		}
		if (obj.get("videoTime") instanceof String) {
			this.setVideoTime((String) obj.get("videoTime"));
		}
		if (obj.get("videoAddr") instanceof String) {
			this.setVideoAddr((String) obj.get("videoAddr"));
		}
		if (obj.get("videoPic") instanceof String) {
			this.setVideoPic((String) obj.get("videoPic"));
		}
		if (obj.get("videoDesc") instanceof String) {
			this.setVideoDesc((String) obj.get("videoDesc"));
		}
		if (obj.get("deptId") instanceof Number) {
			this.setDeptId(((Number) obj.get("deptId")).longValue());
		}
		if (obj.get("status") instanceof Number) {
			this.setStatus(((Number) obj.get("status")).intValue());
		}
		this.setCreateTime((Date) obj.get("createTime"));
		if (obj.get("createBy") instanceof String) {
			this.setCreateBy((String) obj.get("createBy"));
		}
		this.setUpdateTime((Date) obj.get("updateTime"));
		if (obj.get("updateBy") instanceof String) {
			this.setUpdateBy((String) obj.get("updateBy"));
		}
	}
	
	/**
	 * 将当前对象转换为JsonObject
	 * 
	 * @return
	 */
	public JSONObject toJson() {
		JSONObject result = new JSONObject();
		if (this.getId() != null) {
			result.put("id",this.getId());
		}
		if (this.getVideoName() != null) {
			result.put("videoName",this.getVideoName());
		}
		if (this.getVideoTime() != null) {
			result.put("videoTime",this.getVideoTime());
		}
		if (this.getVideoAddr() != null) {
			result.put("videoAddr",this.getVideoAddr());
		}
		if (this.getVideoPic() != null) {
			result.put("videoPic",this.getVideoPic());
		}
		if (this.getVideoDesc() != null) {
			result.put("videoDesc",this.getVideoDesc());
		}
		if (this.getDeptId() != null) {
			result.put("deptId",this.getDeptId());
		}
		if (this.getStatus() != null) {
			result.put("status",this.getStatus());
		}
		if (this.getCreateTime() != null) {
			result.put("createTime",this.getCreateTime());
		}
		if (this.getCreateBy() != null) {
			result.put("createBy",this.getCreateBy());
		}
		if (this.getUpdateTime() != null) {
			result.put("updateTime",this.getUpdateTime());
		}
		if (this.getUpdateBy() != null) {
			result.put("updateBy",this.getUpdateBy());
		}
		return result;
	}


	@Override
	public String toString() {
		return "CurVideo [id=" + id + " , videoName=" + videoName + " , videoTime=" + videoTime + " , videoAddr=" + videoAddr + " , videoPic=" + videoPic + " , videoDesc=" + videoDesc + " , deptId=" + deptId + " , status=" + status + " , createTime=" + createTime + " , createBy=" + createBy + " , updateTime=" + updateTime + " , updateBy=" + updateBy + "  ]";
	
	}
	
	
}
